#ifndef _COLLECTION_H_
#define _COLLECTION_H

#include <qstring.h>
#include <iostream>
#include <vector>
#include <qdom.h>
#include <qlistview.h>
#include <qdialog.h>
#include <qlayout.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qmessagebox.h>
#include <qvariant.h>
#include <qsize.h>
#include <q3listview.h>

using namespace std;

typedef struct{
	QString artist;
	QString title;
	QString sngpath;
	QString mp3path;
	QString difficulty;
	QString quality;
	QString scoremax;
	QString streakmax;
	QString percentmax;
	Q3ListViewItem *listView;
}SONG;

class Collection : public QWidget
{
	Q_OBJECT

	public:
		Collection();
		~Collection();

		void parse(QString filename);
		void loadSong();
		void addEntry(SONG*);
		void removeEntry(SONG*);
		void refreshEntries();
		SONG* findEntry(QString sngpath);
		void saveCollectionAs(QString filename);
		void saveCollection();
		void importCollection(QString filename);
		void showCollection();

	public slots:
		void slotSongDoubleClicked(Q3ListViewItem*);
		void slotItemRenamed(Q3ListViewItem*,int,const QString&);

	private:
		vector<SONG*> m_songs;
		QString m_collectionFile;
		QDomDocument m_domTree;
		QDialog* collecWindow;
		Q3ListView* songlist;
};

#endif
